package com.wenx.v3system.modular.cloud.domain.dto;

import com.wenx.base.domain.BaseDto;
import com.wenx.v3core.enums.StatusEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * 系统团队DTO
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Schema(description = "系统团队信息")
public class SysTeamDto extends BaseDto {

    @Schema(description = "团队ID", example = "1001")
    private Long id;

    @NotBlank(message = "团队名称不能为空")
    @Size(max = 100, message = "团队名称长度不能超过100个字符")
    @Schema(description = "团队名称", example = "开发团队")
    private String name;

    @NotBlank(message = "团队编码不能为空")
    @Size(max = 50, message = "团队编码长度不能超过50个字符")
    @Schema(description = "团队编码", example = "DEV_TEAM")
    private String code;

    @Size(max = 500, message = "团队描述长度不能超过500个字符")
    @Schema(description = "团队描述", example = "负责产品开发工作")
    private String description;

    @NotNull(message = "所属部门ID不能为空")
    @Schema(description = "所属部门ID", example = "2001")
    private Long departmentId;

    @Schema(description = "父团队ID", example = "1000")
    private Long parentId;

    @Schema(description = "团队负责人用户ID", example = "3001")
    private Long leaderId;

    @Schema(description = "排序", example = "1")
    private Long sort;

    @Schema(description = "团队状态：1-启用，0-禁用", example = "1")
    private StatusEnum status;

    // 关联关系
    @Schema(description = "团队成员列表")
    private List<SysUserDto> members;

    @Schema(description = "所属部门信息")
    private SysDepartmentDto department;

    @Schema(description = "父团队信息")
    private SysTeamDto parent;

    @Schema(description = "子团队列表")
    private List<SysTeamDto> children;

    @Schema(description = "团队负责人信息")
    private SysUserDto leader;

    @Schema(description = "团队成员数量", example = "5")
    private Integer memberCount;
}